//
//  MeHelpTableViewCell.m
//  BGM
//
//  Created by liuqin on 2018/11/29.
//  Copyright © 2018年 com.alirtc.demo. All rights reserved.
//

#import "MeHelpTableViewCell.h"
#import "CommonBtn.h"
#import "Common.h"
@interface MeHelpTableViewCell()

@end

@implementation MeHelpTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self != nil) {
        
        self.backgroundColor = [UIColor clearColor];
        //时间
        self.timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(40, 0, SCREENW, 30)];
        self.timeLabel.text = @"2018-10-20";
        self.timeLabel.font = [UIFont systemFontOfSize:12];
        self.timeLabel.textColor = bgmsmallColor;
        [self addSubview:self.timeLabel];
        
        
        
        UIImageView *iconImage = [[UIImageView alloc]initWithFrame:CGRectMake(20, 7, 15, 15)];
        [iconImage setImage:[UIImage imageNamed:@"pushCircle"]];
        [self addSubview:iconImage];
        
        UILabel *line = [[UILabel alloc]initWithFrame:CGRectMake(27, iconImage.frame.origin.y+iconImage.frame.size.height, 0.3,130-iconImage.frame.size.height)];
        line.backgroundColor = [UIColor grayColor];
        line.alpha = 0.3;
        [self addSubview:line];
        
        UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(45, 30, SCREENW-60, 100)];
        bgView.backgroundColor = [UIColor whiteColor];
        bgView.layer.cornerRadius = 6;
        bgView.layer.masksToBounds = YES;
        [self addSubview:bgView];
        
     
        //头像
        self.headImage = [[UIImageView alloc]initWithFrame:CGRectMake(15, 15, bgView.frame.size.height/2, bgView.frame.size.height/2)];
        self.headImage.layer.masksToBounds = YES;
        self.headImage.layer.cornerRadius = self.headImage.frame.size.height/2;
        self.headImage.backgroundColor = bgmColor(224, 224, 224);
        [bgView addSubview:self.headImage];
        
        self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.headImage.frame.origin.x+self.headImage.frame.size.width+10, 5, bgView.frame.size.width-self.headImage.frame.size.width-30, 30)];
        self.nameLabel.textColor = bgmgrayColor;
        self.nameLabel.font = [UIFont systemFontOfSize:14];
        [bgView addSubview:self.nameLabel];
        
        self.statusImage = [[UIImageView alloc]initWithFrame:CGRectMake(self.nameLabel.frame.origin.x, self.nameLabel.frame.origin.y+self.nameLabel.frame.size.height+8, 25, 25)];
        [bgView addSubview:self.statusImage];
        
        
        self.messageLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.statusImage.frame.origin.x+self.statusImage.frame.size.width+5, self.statusImage.frame.origin.y-3, bgView.frame.size.width-self.headImage.frame.size.width-30-40, bgView.frame.size.height/4)];
        self.messageLabel.textColor = bgmmainColor;
        self.messageLabel.font = [UIFont systemFontOfSize:17];
        [bgView addSubview:self.messageLabel];
        
        self.commentBtn = [[CommonBtn alloc]initWithFrame:CGRectMake(bgView.frame.size.width-100, bgView.frame.size.height-30, 50, 30)];
        [self.commentBtn setImage:[UIImage imageNamed:@"pinglun"] forState:UIControlStateNormal];
        [self.commentBtn setTitle:@"12" forState:UIControlStateNormal];
        [bgView addSubview:self.commentBtn];
        
        self.forwardBtn = [[CommonBtn alloc]initWithFrame:CGRectMake(bgView.frame.size.width-50, bgView.frame.size.height-30, 50, 30)];
        [self.forwardBtn setImage:[UIImage imageNamed:@"zhuanfa"] forState:UIControlStateNormal];
        [self.forwardBtn setTitle:@"52" forState:UIControlStateNormal];
        [bgView addSubview:self.forwardBtn];
        
        UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(bgView.frame.size.width-80, self.nameLabel.frame.origin.y+7, 10, 10)];
        label.backgroundColor = bgmColor(252, 225, 83);
        label.layer.cornerRadius = 5;
        label.layer.masksToBounds = YES;
        [bgView addSubview:label];
        
        self.resultLabel = [[UILabel alloc]initWithFrame:CGRectMake(label.frame.size.width+label.frame.origin.x+10, label.frame.origin.y, 60, 10)];
        self.resultLabel.text = @"进行中";
        self.resultLabel.textColor = bgmgrayColor;
        self.resultLabel.font = [UIFont systemFontOfSize:14];
        [bgView addSubview:self.resultLabel];

        
        self.label2 = [[UILabel alloc]initWithFrame:CGRectMake(self.nameLabel.frame.origin.x-10, self.commentBtn.frame.origin.y,40, 20)];
        self.label2.textColor = bgmgrayColor;
        self.label2.backgroundColor = bgmColor(250, 241, 194);
        self.label2.font = [UIFont systemFontOfSize:12];
        self.label2.layer.cornerRadius = 9;
        self.label2.layer.masksToBounds = YES;
        self.label2.textAlignment = NSTextAlignmentCenter;
        self.label2.layer.borderColor = bgmColor(250, 203, 11).CGColor;
        self.label2.layer.borderWidth = 1;
        [bgView addSubview:self.label2];
        
        self.label1 = [[UILabel alloc]initWithFrame:CGRectMake(self.label2.frame.origin.x+ self.label2.frame.size.width +5, self.commentBtn.frame.origin.y, 70, 20)];
        self.label1.text = @"帮转红包";
        self.label1.textColor = bgmgrayColor;
        self.label1.backgroundColor = bgmColor(250, 241, 194);
        self.label1.font = [UIFont systemFontOfSize:12];
        self.label1.layer.cornerRadius = 9;
        self.label1.layer.masksToBounds = YES;
        self.label1.textAlignment = NSTextAlignmentCenter;
        self.label1.layer.borderColor = bgmColor(250, 203, 11).CGColor;
        self.label1.layer.borderWidth = 1;
        [bgView addSubview:self.label1];
        
      
        
    }
    return self;
}


@end
